package group.sicher.common.entity;

import group.sicher.common.constant.senum.DeliverStatusEnum;
import group.sicher.common.constant.senum.WorkTypeEnum;

import javax.persistence.*;
import java.util.Objects;

/**
 * @Auth rock
 * @Date 2019/7/1 21:07
 * @description
 */
@Entity
@Table(name = "wm_deliver")
public class DeliverEntity {

    private Long id;
    private Long userId;
    private String name;
    private String mobile;
    private String score;
    private DeliverStatusEnum status;
    private WorkTypeEnum type;
    private Long monthTaskNum;
    private Long totalTaskNum;
    private Long agentId;
    private Long organId;
    private String agentName;
    private String organName;
    private Long createAt;
    private Long updateAt;

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "id", nullable = false)
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    @Basic
    @Column(name = "user_id", nullable = false)
    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    @Basic
    @Column(name = "name", nullable = true, length = 20)
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Basic
    @Column(name = "mobile", nullable = true, length = 20)
    public String getMobile() {
        return mobile;
    }

    public void setMobile(String mobile) {
        this.mobile = mobile;
    }

    @Basic
    @Column(name = "score", nullable = true, length = 20)
    public String getScore() {
        return score;
    }

    public void setScore(String score) {
        this.score = score;
    }

    @Basic
    @Column(name = "status", nullable = true)
    public DeliverStatusEnum getStatus() {
        return status;
    }

    public void setStatus(DeliverStatusEnum status) {
        this.status = status;
    }

    @Basic
    @Column(name = "type", nullable = true)
    public WorkTypeEnum getType() {
        return type;
    }

    public void setType(WorkTypeEnum type) {
        this.type = type;
    }

    @Basic
    @Column(name = "month_task_num", nullable = true)
    public Long getMonthTaskNum() {
        return monthTaskNum;
    }

    public void setMonthTaskNum(Long monthTaskNum) {
        this.monthTaskNum = monthTaskNum;
    }

    @Basic
    @Column(name = "total_task_num", nullable = true)
    public Long getTotalTaskNum() {
        return totalTaskNum;
    }

    public void setTotalTaskNum(Long totalTaskNum) {
        this.totalTaskNum = totalTaskNum;
    }

    @Basic
    @Column(name = "agent_id", nullable = true)
    public Long getAgentId() {
        return agentId;
    }

    public void setAgentId(Long agentId) {
        this.agentId = agentId;
    }

    @Basic
    @Column(name = "organ_id", nullable = true)
    public Long getOrganId() {
        return organId;
    }

    public void setOrganId(Long organId) {
        this.organId = organId;
    }

    @Basic
    @Column(name = "agent_name", nullable = true, length = 60)
    public String getAgentName() {
        return agentName;
    }

    public void setAgentName(String agentName) {
        this.agentName = agentName;
    }

    @Basic
    @Column(name = "organ_name", nullable = true, length = 60)
    public String getOrganName() {
        return organName;
    }

    public void setOrganName(String organName) {
        this.organName = organName;
    }

    @Basic
    @Column(name = "create_at", nullable = true)
    public Long getCreateAt() {
        return createAt;
    }

    public void setCreateAt(Long createAt) {
        this.createAt = createAt;
    }

    @Basic
    @Column(name = "update_at", nullable = true)
    public Long getUpdateAt() {
        return updateAt;
    }

    public void setUpdateAt(Long updateAt) {
        this.updateAt = updateAt;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        DeliverEntity that = (DeliverEntity) o;
        return id == that.id &&
                userId == that.userId &&
                Objects.equals(name, that.name) &&
                Objects.equals(mobile, that.mobile) &&
                Objects.equals(score, that.score) &&
                Objects.equals(status, that.status) &&
                Objects.equals(type, that.type) &&
                Objects.equals(monthTaskNum, that.monthTaskNum) &&
                Objects.equals(totalTaskNum, that.totalTaskNum) &&
                Objects.equals(agentId, that.agentId) &&
                Objects.equals(organId, that.organId) &&
                Objects.equals(agentName, that.agentName) &&
                Objects.equals(organName, that.organName) &&
                Objects.equals(createAt, that.createAt) &&
                Objects.equals(updateAt, that.updateAt);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, userId, name, mobile, score, status, type, monthTaskNum, totalTaskNum, agentId, organId, agentName, organName, createAt, updateAt);
    }
}
